#ifndef VICONBODY_H
#define VICONBODY_H

#define MAX_BODYNAME_LEN 30

typedef struct {
	double x;
	double y;
	double z;
} Vector3;

class ViconBody
{
private:
	ViconBody* m_next;

	char *m_name;

	unsigned int m_offsets[6];

	bool m_exists;

	bool m_dataValid;

	Vector3 m_worldPos;
	Vector3 m_worldOr;

	friend class ViconHandler;
	friend class ViconFrame;

	ViconBody(char* _name);

	void SetData(double _px, double _py, double _pz, double _ox, double _oy, double _oz);
	void SetNext(ViconBody* _b) { m_next = _b; }

	void SetExists(bool _t) { m_exists = _t; }
	inline bool GetExists() { return m_exists; }
	void SetOffset(unsigned int _i, unsigned int _offset) { m_offsets[_i] = _offset; }

	void SetDataValid(bool _t) { m_dataValid = _t; }

	inline unsigned int GetOffset(unsigned int _i) { return ((_i<6) ? m_offsets[_i] : -1); }

public:
	inline char* GetName() { return m_name; }
	inline ViconBody* GetNext() { return m_next; }
	inline Vector3 GetWorldPos() { return m_worldPos; }
	inline Vector3 GetWorldOr() { return m_worldOr; }
	inline bool GetIsDataValid() { return m_dataValid; }

};

#endif
